//
//  TTUserModel.h
//  ExhibitionHall
//
//  Created by 王洋 on 2019/6/15.
//  Copyright © 2019 王洋. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "TTInstallModel.h"

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSInteger, TTUserType) {
    //未知
    TTUserType_unKnow,
    //新用户
    TTUserType_new,
    //老用户
    TTUserType_old
};

@interface TTUserModel : NSObject

+ (TTUserModel *)sharedObject;

//初始化
- (void)initialization;

- (void)logOut;


- (void)fillUserModelWithDic:(NSMutableDictionary *)userDic;


@property (nonatomic, strong) NSUserDefaults *userModelDefault;

/*
 alipayId = "";
 availableAmount = "";
 collectionOpusNum = "";
 collectionPackagesNum = "";
 collectionSellerNum = "";
 createEndTime = "";
 createStartTime = "";
 createTime = "2020-08-08 11:18:44";
 iceAmount = "";
 imId = "";
 imgUrl = "";
 inviteesNumber = 0;
 isDel = 2;
 isMarry = "";
 latestOnlineTime = "";
 marryTime = "";
 myCode = USAAAE;
 nickname = "\U7528\U6237709406";
 openId = "";
 password = a80d0cc714d1a7d98e36c483c2283d2f843ddfb6;
 payPassword = "";
 recommender = "";
 sex = "";
 totalAmount = "";
 totalOrderMoney = "";
 totalOrderNum = "";
 updateTime = "2020-08-08 11:18:44";
 updateUser = "";
 userId = 7980277871100850176;
 userState = "";
 username = 15305608830;
 */
@property(nonatomic,readonly) NSString* token;

@property(nonatomic,readonly) TTUserType isNewer;


@property (nonatomic, readonly) NSString *username;
@property (nonatomic, readonly) NSString *nickname;
@property (nonatomic, readonly) NSString *userIcon;
@property (nonatomic, readonly) NSInteger sex;

@property (nonatomic, readonly) NSString *autograph;

@property (nonatomic, assign) BOOL isRegister;//用户打开app时间


@property (nonatomic, readonly) NSString *marryTime;

@property (nonatomic, readonly) NSString *password;

@property (nonatomic, readonly) NSString *myCode;

@property (nonatomic, readonly) NSString *userId;

@property (nonatomic, strong) NSData *deviceToken;


@property(nonatomic,readonly) NSString* alipayId;

@property(nonatomic,readonly) NSString* realName;


@property(nonatomic,readonly) NSString* wechatNo;


//用于标记用户信息刷新时间 一旦变化，说明用户信息变了
@property(nonatomic,assign) NSTimeInterval timeTag;//用户打开app时间


//以下为用户+设备关联信息
@property(nonatomic,readonly) double latitude;
@property(nonatomic,readonly) double longitude;

@property(nonatomic,readonly) NSTimeInterval openAppTime;//用户打开app时间
@property(nonatomic,readonly) NSTimeInterval loginTime;//用户登录时间
@property(nonatomic,readonly) NSTimeInterval logOutTime;//用户退出登录时间

//IM_用户名
@property(nonatomic,readonly) NSString* identifier;
//IM鉴权
@property(nonatomic,readonly) NSString* userSig;
//App 用户使用 OAuth 授权体系分配的 Appid
@property(nonatomic,readonly) NSString* appidAt3rd;

//城市名
@property(nonatomic,readonly) NSString* cityName;
//城市ID
@property(nonatomic,readonly) NSString* cityId;



@property (nonatomic, readonly) NSMutableArray *searchHistoryArray;

@property (nonatomic, readonly) NSMutableArray *imKeyWordArray;



@property(nonatomic,strong) TTInstallModel *installModel;


- (void)addSearchHistoryWithKeyWord:(NSString *)keyWord;

- (void)clearSearchHistory;

@end

NS_ASSUME_NONNULL_END
